package com.yjxz.shop.backend.controller;

import com.yjxz.shop.backend.entity.Test;
import com.yjxz.shop.backend.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping("/test")
public class TestController {
    @Autowired
    TestService testService;

    @RequestMapping("/test1")
    public String test1(Model m) {
        Test test = testService.getById(1);
        m.addAttribute("t", test);
        return "test";
    }
}
